﻿/**************************************************************************
创建日期:	2019/7/23 23:41:26     
作	  者:	张存
邮 	  箱:	zhangcunliang@126.com
创建时间:	
Copyright (c)    ZhCun.cn

描	述：
记	录：
***************************************************************************/
using System;
using System.Collections.Generic;
using System.Text;
using ZhCun.DbCore.Cores;
using ZhCun.DbCore.Entitys;
using ZhCun.WebCommon.ViewModels;

namespace ZhCun.WebCommon.AL
{
    public abstract class ALReadPagerBase<TListArg, TListModel> : BaseAL
        where TListArg : ArgGetList, new()
        where TListModel : EntityBase, new()
    {
        protected abstract void SetQueryOption(TListArg arg, QueryCondition<TListModel> query);

        public virtual List<TListModel> GetList(TListArg arg, out int total)
        {
            return
            GetPagerList<TListModel>(arg.page, arg.limit, out total, query => 
            {
                SetQueryOption(arg, query);
            });
        }
    }
}